/** @odoo-module **/
import {registry} from "@web/core/registry";
import {listView} from "@web/views/list/list_view";
import {ListController} from "@web/views/list/list_controller";
import {useService} from "@web/core/utils/hooks"

export class GeneBalance extends ListController {

    setup() {
        super.setup();
        this.ormService = useService("orm")
    }


    action_generate_balance() {
        if (confirm("注意！此按钮只用于余额逻辑产生之前用户余额记录的生成！")) {
            this.ormService.call('rp.customer', 'action_generate_balance')
        }
    }

}

registry.category("views").add("gene_balance", {
    ...listView,
    Controller: GeneBalance,
    buttonTemplate: "rp_customer_management.ListView.buttons",
});